package com.greenline.push.services.dto;

import java.io.Serializable;

/**
 * @Type ResponseDTO
 * @Desc 请求返回对象
 * @author weirui.shenwr
 * @date 2012-5-11
 * @Version V1.0
 */
public class ResponseDTO<T> implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 8357930917603201237L;

    /**
     * 返回code 0：成功 1：异常 2：业务错误 xxx:其他自定义code
     */
    private String code = ResponseCode.SUCCESS;

    /**
     * 消息
     */
    private String message = "";
    /**
     * 存放错误消息
     */
    private String errorMsg = "";

    private T dataResult;

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getDataResult() {
        return dataResult;
    }

    public void setDataResult(T dataResult) {
        this.dataResult = dataResult;
    }

    public void setResult(String code, String message) {
        this.message = message;
        this.code = code;
    }

    public void setResult(String code, String message, T dataResult) {
        this.message = message;
        this.code = code;
        this.dataResult = dataResult;
    }

}
